#pragma once

#include <cstdint>
#include <cstdlib>
#include <cstring>

using hash_t = std::uint64_t;

constexpr hash_t prime = 0x100000001B3ULL;
constexpr hash_t basis = 0xCBF29CE484222325ULL;

constexpr inline static auto hash(const char* str) -> hash_t
{
    hash_t ret{basis};
    while (*str != 0)
    {
        ret ^= *str;
        ret *= prime;
        str++;
    }
    return ret;
}

constexpr auto operator""_hash(char const* str, hash_t) -> hash_t { return hash(str); }
